package com.fanghuaiming.lcn.item.service.impl;

import com.codingapi.txlcn.tc.annotation.LcnTransaction;
import com.fanghuaiming.lcn.item.dao.mapper.SkuMapper;
import com.fanghuaiming.lcn.item.dao.model.Sku;
import com.fanghuaiming.lcn.item.service.ItemService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/****
 * @description: 商品服务接口实现类
 * @version:1.0.0
 * @author fanghuaiming
 * @data Created in 2020/11/27 下午1:59
 *
 */
@Service
@Slf4j
public class ItemServiceImpl implements ItemService {

    /**
     * 商品mapper
     */
    @Autowired
    private SkuMapper skuMapper;

    /**
     * @Description: 扣减商品sku
     *
     * @param:
     * @return:
     * @auther: fanghuaiming
     * @date: 2020/11/27 下午2:27
     * @version:1.0.0
     */
    @SuppressWarnings("all")
    @Transactional
    @LcnTransaction
    @Override
    public void reduceItem(Sku sku) {
        log.info("=================开始请求-商品微服务-reduceItem扣减商品Service接口=================");
        skuMapper.reduceItem(sku);
        log.info("=================请求-商品微服务-reduceItem扣减商品Service接口完成=================");
    }
}
